package com.vpx.server.controller.system;

import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.IdUtil;
import com.vpx.server.bean.entity.CProjectAttr;
import com.vpx.server.framework.base.ResultMsg;
import com.vpx.server.service.system.CProjectAttrService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(tags="")
@RestController
@RequestMapping("/api/cprojectattr")
public class CProjectAttrController {

    @Autowired
    private CProjectAttrService service;
    @ApiOperation("添加")
    @PostMapping("/insert")
    public ResultMsg insert(CProjectAttr c){
        c.setId(IdUtil.simpleUUID());
        c.setCreateTime(DateUtil.date(System.currentTimeMillis()).toString());
        service.insert(c);
        return ResultMsg.success("");
    }
    @ApiOperation("删除")
    @GetMapping("/delete")
    public ResultMsg delete(CProjectAttr c){
        service.delete(c);
        return ResultMsg.success("");
    }
    @ApiOperation("修改")
    @PostMapping("/update")
    public ResultMsg update(CProjectAttr c){
        service.update(c);
        return ResultMsg.success("");
    }
    @ApiOperation("查询所有")
    @GetMapping("/selectALl")
    public ResultMsg selectALl(CProjectAttr c){
        return ResultMsg.success(service.selectAll());
    }
}
